package com.code.softeem.zuoye.demo2;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/20 17:07
 * @description
 */
public class Car extends Auto{
    private String kongtiao;
    private String CD;

    public Car(int ltgs, String color, double zhong, double speed, String kongtiao, String CD) {
        super(ltgs, color, zhong, speed);
        this.kongtiao = kongtiao;
        this.CD = CD;
    }



    public Car() {
    }

    public String getKongtiao() {
        return kongtiao;
    }

    public void setKongtiao(String kongtiao) {
        this.kongtiao = kongtiao;
    }

    public String getCD() {
        return CD;
    }

    public void setCD(String CD) {
        this.CD = CD;
    }
        public void speedUp(){
        setSpeed(getSpeed()+10);
    }
    public void speedDown(){
        setSpeed(getSpeed()-10);
    }

    public void getInfo(){
        System.out.println("这个"+getLtgs()+"轮"+getZhong()+"kg"+
                getColor()+"的小汽车正在以"+getSpeed()+"km/h的速度行驶"+
                "而且开着"+kongtiao+"°的空调，CD在播放"+CD);
    }
}
